package cn.ad.server.persistence.dao;

import java.util.List;

import cn.ad.server.domain.ad.InteractionApp;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

@Component
public interface InteractionAppDao {

	@Results(value = { 
			@Result(column = "id", property = "id", id=true),
			@Result(column = "store_id", property = "storeId"),
			@Result(column = "app_type", property = "appType"),
			@Result(column = "download_url", property = "downloadUrl"),
			@Result(column = "classes_id", property = "classesId"),
			@Result(column = "app_volume", property = "appVolume"),
			@Result(column = "apk_name", property = "apkName") })
	@Select("select * from interaction_app")
	List<InteractionApp> findAll();
	
//	@Results(value = { 
//			@Result(column = "id", property = "id", id=true),
//			@Result(column = "store_id", property = "storeId"),
//			@Result(column = "app_type", property = "appType"),
//			@Result(column = "download_url", property = "downloadUrl"),
//			@Result(column = "classes_id", property = "classesId"),
//			@Result(column = "app_volume", property = "appVolume"),
//			@Result(column = "apk_name", property = "apkName") })
//	@Select("select * from interaction_app where update_time >= #{value} ")
//	public List<InteractionApp> findAfterTime(String warmUpTime);
	
	@Results(value = { 
			@Result(column = "id", property = "id", id=true),
			@Result(column = "store_id", property = "storeId"),
			@Result(column = "app_type", property = "appType"),
			@Result(column = "download_url", property = "downloadUrl"),
			@Result(column = "classes_id", property = "classesId"),
			@Result(column = "app_volume", property = "appVolume"),
			@Result(column = "apk_name", property = "apkName") })
	@Select("select * from interaction_app where id = #{value}")
	public InteractionApp findById(long id);

}
